import request from '@/utils/request'
// 兑换码生成
export function giftCode(data) {
    const formData = new FormData()
    for (const key in data) {
        formData.append(key, data[key])
    }
    return request({
        url: '/giftCode/data.auth',
        method: 'post',
        data: formData
    })
}

// 礼包码保存
export function giftCodeSave(data) {
    const formData = new FormData()
    for (const key in data) {
        formData.append(key, data[key])
    }
    return request({
        url: '/giftCode/save.authw',
        method: 'post',
        data: formData
    })
}

// 启用礼包码
export function giftCodeOpen(data) {
    const formData = new FormData()
    for (const key in data) {
        formData.append(key, data[key])
    }
    return request({
        url: '/giftCode/usable.authw',
        method: 'post',
        data: formData
    })
}
  
// 通用兑换码日志
export function giftCodeShareLog(data) {
    const formData = new FormData()
    for (const key in data) {
        formData.append(key, data[key])
    }
    return request({
        url: '/giftCodeShareLog/data.auth',
        method: 'post',
        data: formData
    })
}

// 随机兑换码日志
export function giftCodeRandomLog(data) {
    const formData = new FormData()
    for (const key in data) {
        formData.append(key, data[key])
    }
    return request({
        url: '/giftCodeRandomLog/data.auth',
        method: 'post',
        data: formData
    })
}